<?php $uClass   = $sf_params->get('uClass') ?>
<?php $dbClass  = $sf_params->get('dbClass') ?>
<?php $stcClass = $sf_params->get('stcClass') ?>
<?php $ns       = $sf_params->get('ns') ?>

<?php $object = $form->getObject() ?>
<?php //*** POCH 2009-03-03 ***// ?>
<?php if (!isset($action)): ?>
  <?php $action = $object->isNew() ? 'Add' : 'Edit' ?>
<?php endif; ?>
<?php //***  ***// ?>

<?php $hiddens = isset($hiddens) ? $hiddens : array('id') ?>

<?php $title      = isset($title)      ? $title : '' ?>
<?php $title_size = isset($title_size) ? sprintf('font-size: %spx;', $title_size) : '' ?>
<?php $text_size  = isset($text_size)  ? sprintf('font-size: %spx;', $text_size)  : '' ?>

<table class="content page_block" cellspacing=0 cellpadding=0 width="100%" border="0">
  <?php include_partial('Crud/breadcrumb_edit', array('action' => $action)) ?>
  <tr>
    <td valign="top" style="padding-top: 3px;">
      <div class="content_div" style="padding: 3px 7px 0px;">
      
        <table width="100%" cellspacing="0" cellpadding="5" border="0">
          <tr class="title">
            <td width="100%">
              <span style="padding-left: 6px;">
                &nbsp;
              </span>
            </td>
          </tr>
          <tr>
            <td>
              <table class="form normal" width="100%" cellpadding="2" cellspacing="0" border="0">
                <tr>
                  <td>
                    <?php if (!isset($action_url)): ?>
                      <?php $action_url = !$object->isNew() ? sprintf('@%s_edit?name_url=%s', $uClass, $object->getNameUrl()) : sprintf('@%s_new', $uClass) ?>
                    <?php endif ?>
                    
                    <?php $action_url = url_for($action_url) ?>
                    
                    <?php if (has_slot('extra_top')): ?>
                      <?php include_slot('extra_top') ?>
                    <?php endif; ?>
                  </td>
                </tr>
                <tr>
                  <td>   
                    <table class="form normal" cellspacing="1" cellpadding="5" align="left" width="100%" border="0">
                      <?php if (!has_slot('extra_top')): ?>
                      <tr>
		                <td class="popup_dialog_body_left_padded" style="vertical-align: top;" width="100%" align="left" colspan="2">
		                  <span style="padding-left: 45px; <?php echo $title_size ?>; color: #2B7DC7"><b><?php echo $title; ?></b></span>
		                </td>
                      </tr>
                      <?php endif; ?>
                      <?php if (isset($text)): ?>
                      <tr>
                        <td class="popup_dialog_body_left_padded" style="vertical-align: top;" width="100%" align="left" colspan="2">
                        <span style="padding-left: 100px; <?php echo $text_size ?>"><?php echo $text ?></span>
                        <br />
                      </td>
                      </tr>
                      <?php endif; ?>
                      <tr>
                        <td align="center" valign="top" height="25"  style="border-right: 2px ridge black;" width="25%">
					      <?php if (isset($slot1)): ?>
					        <?php include_partial('Printing/other_actions', array('questions' => $questions)) ?>
					      <?php else: ?>
					        &nbsp;
					      <?php endif; ?>
                        </td>
                        <td align="left" valign="middle" height="25" width="75%">
                          <?php if (has_slot('error_summary')): ?>
                            <?php include_slot('error_summary') ?>
                          <?php endif; ?>
                          
                          <?php if (has_slot('info')): ?>
                            <?php include_slot('info') ?>
                          <?php endif; ?>
		                    <form 
		                      name="<?php echo $uClass ?>" 
		                      action="<?php echo $action_url ?>" 
		                      method="post" <?php $form->isMultipart() and print 'enctype="multipart/form-data" ' ?>
		                    >
		                    
		                      <?php include_partial
		                            (
		                              'Crud/form', 
		                              get_objective_vars(get_defined_vars())
		                            )
		                      ?>
		                    </form>
                            <?php include_partial
                                  (
                                    'Crud/process_buttons_edit', 
                                    array
                                    (
                                      'object'          => $object, 
                                    )
                                  )
                            ?>
                        </td>
                      </tr>
                    </table>
                    
                  </td>
                </tr>
              
              </table>
 
            </td>
          </tr>
          
          <tr>
            <td>
              <?php if (has_slot('extra')): ?>
		        <?php include_slot('extra') ?>
		      <?php endif; ?>
            </td>
          </tr>
        </table>
      </div>

    </td>
  </tr>
</table>

<?php echo javascript_tag('setFromState()') ?>
<?php echo javascript_tag('setFocusOnFirstElement();') ?>